/**
 * Created by Skipper on 2017/3/31.
 */
import React from 'react';
import ReactDom from 'react-dom';
import {message, Modal} from 'antd';
const confirm = Modal.confirm;

export default function showConfirm(data, arg) {
  confirm({
    title: arg.title,
    content: arg.content,
    onOk() {
      let TOKEN = localStorage.getItem('token') ? localStorage.getItem('token') : 'MSMxNDg3MjExNzU1QGppZXlhbi54eWl0ZWNoLmNvbSNYTlFpWlpoM3IyVTNVTVk3K2hQQmp6bTZjMlk9';
      let url = arg.url + '&token=' + TOKEN;
      console.log('发送的数据是  ', url, '  传参数数据是  ', data);
      // fetch(url)
      //   .then(function (response) {
      //     return response.json()
      //   })
      //   .then(function (data) {
      //     if (data.err == 0) {
      //       message.success('删除成功，后会无期👋！', 5);
      //     } else {
      //       message.error('想摆脱我，没那么容易', 5);
      //     }
      //   })
      //   .catch(function (e) {
      //     console.log("Oops, error", e);
      //     message.error('人品不好，发生错误了，请积攒人品重新尝试', 5);
      //   });
    },
    onCancel() {
      console.log('取消');
    },
  });
}
